package joshua.web.facade;

import java.util.Date;
import java.util.List;
import java.util.Map;

import joshua.hibernate.dao.UserThreadDAO;

import org.springframework.stereotype.Service;

@Service("persistenceFacade")
public class PersistenceFacadeImpl extends PersistenceFacade {

	
	public boolean addThread(String userName, String detail, Date updateDate) {
		UserThreadDAO userThreadDAO = new UserThreadDAO();
		userThreadDAO.save(userName, detail, updateDate);
		return true;
	}
	
	
	
	public boolean deleteThreadById(int threadId) {
		UserThreadDAO userThreadDAO = new UserThreadDAO();
		userThreadDAO.delete(threadId);
		return true;
	}
	
	
	
	public List<Map<String, Object>> getAllThread() {
		UserThreadDAO userThreadDAO = new UserThreadDAO();
		return userThreadDAO.findAll();
	}
}
